  <?php
error_reporting(E_ALL ^ E_DEPRECATED);
?>
<?php   
require_once ("dbconnect.php");
if(!isset($_SESSION['username']))
	{
 	echo '<!doctype html>
<head>
<meta charset="utf-8" />
<title>请登陆</title>
</head>
<noframes><body></noframes>
<div align="center">
<h2>温馨提示：若要进入管理<a href="admin.php">点此登陆</a></h2>  
<span class="copyright">CopyRight 2014-2015 <a href="https://yanyu-dyh.rhcloud.com/">@虎哥Style</a></span>
</div>
</body>
</html>';
exit();
}?>
<?php
	/*************************************/
	/*        文件名：edit.php		    */
	/*        功能：?写留言信息		*/
	/************************************/

	include "dbconnect.php";

	//取得留言内容
	$id = intval($_GET['id']);	//所??的留言ID
	$res = mysql_query("SELECT * FROM guestbook WHERE id=$id");
	$row = mysql_fetch_object($res);
?>
<html>
<head>
<title>编辑留言</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center">
<form name="FormName" method="post" action="finish.php">
<input type="hidden" name="act" value="edit">
<input type="hidden" name="id" value="<?php echo $row->id ?>">
 <table width="90%" border="0" cellpadding="4" cellspacing="1">
  <tr>
	<td colspan="2" class="HeaderRow">编辑留言</td>
  </tr>
  <tr>
	<td colspan="2" class="SubTitleRow"><span class="redfont">提示：（*）内容必须填写</span></td>
  </tr>
  <tr>
   <td width="25%" align="right" class="InputRow">姓名；</td>
   <td width="75%" class="InputRow">
    <input name="name" type="text" id="name" size="25" maxlength="10" value="<?php echo ($row->name) ?>">
    <span class="redfont">（*）</span>   </td>
  </tr>
  <tr>
   <td width="25%" align="right" class="InputRow">是否公开：</td>
   <td width="75%" class="InputRow">
    <input name="ni" type="radio" id="ni" value="1" <?php if($row->ni==1) echo "checked";?>>是
    <input name="ni" type="radio" id="ni" value="0" <?php if($row->ni==0) echo "checked";?> > 否
    </td>
  <tr>
   <td align="right">留言内容：</td>
   <td>
    <textarea name="comment" cols="120" rows="20" id="comment"><?php echo ($row->comment) ?></textarea>
  </td>
  </tr>
  <tr>
   <td colspan="2" align="center">
    <input name="submit" type="submit" id="submit" value=" 提交留言 ">
	<input type="button" value=" 返回 " onClick="location.href='index.php'">
   </td>
  </tr>
 </table>
</form>
</div>
</body>
</html>
